package com.glory.cqaospda.viewmodel

import com.glory.cqaospda.model.TaskRepository
import com.glory.mvvmnet.base.BaseViewModel
import com.glory.mvvmnet.entity.CallObserveBean
import com.google.gson.JsonObject

class QuerySparePartsLifeModel :BaseViewModel() {

    private val repository by lazy { TaskRepository() }

    fun defaultQuerySparePartsLife(eqpID: String) {
        val map = JsonObject()
        map.addProperty("EquipmentName", eqpID)
        launchWithError({
            val queryRaptsInfoBean =
                repository.defaultQuerySparePartsLife(map,"EMS_RaptsInfo")
            defUI.callObserve.value = CallObserveBean(1,queryRaptsInfoBean)
        },{
            defUI.callObserve.value = CallObserveBean(2)
        })
    }

}